package com.service.serviceImpl;

import com.dao.PersonDao;
import com.entity.Person;
import com.github.pagehelper.PageHelper;
import com.service.PersonService;
import com.service.serviceImpl.base.BaseServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Administrator on 2018-9-27 0027.
 */
@Service
@Transactional
public class PersonServiceImpl extends BaseServiceImpl<PersonDao, Person> implements PersonService {

    @Autowired
    private PersonDao personDao;

    @Override
    @Transactional(readOnly = true)
    public List<Person> getAll() {
        return personDao.selectAll();
    }

    @Override
    public List<Person> getPageList(int pageIndex, int pageSize) throws Exception {
        PageHelper.startPage(pageIndex, pageSize);
        return personDao.selectAll();
    }

    @Override
    public Person getById(Integer id) throws Exception {
        return super.getById(id);
    }

    @Override
    public boolean insert(Person person) throws Exception {
        return super.insert(person);
    }

    @Override
    public boolean deleteById(Integer id) throws Exception {
        return super.deleteById(id);
    }

    @Override
    public boolean update(Person person) throws Exception {
        return super.update(person);
    }

    @Override
    public List<Person> getList(Person person) throws Exception {
        return super.getList(person);
    }

}
